<?php
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition End User License Agreement
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magento.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     enterprise_iphone
 * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
 * @license http://www.magento.com/license/enterprise-edition
 */
?>

<div class="page-title">
    <h1><?php echo Mage::helper('enterprise_giftregistry')->__('Gift Registry'); ?></h1>
</div>
<div class="giftregistry">
<?php $entityCollection = $this->getEntityCollection(); ?>
<?php echo $this->getMessagesBlock()->toHtml();?>

<?php if ($entityCollection->getSize()):?>
    <?php echo $this->getChildHtml('pager') ?>
    <ul class="list">
        <?php foreach($entityCollection as $item): ?>
            <li class="list-item">

                <a class="btn-remove" href="<?php echo $this->getDeleteUrl($item)?>" onclick="return confirm('<?php echo Mage::helper('enterprise_giftregistry')->__('Are you sure you want to delete this gift registry?'); ?>');"><?php echo $this->__('Delete') ?></a>
                <h2><?php echo $this->helper('core/string')->truncate($this->getEscapedTitle($item), 70)?></h2>
                <a class="link-edit" href="<?php echo $this->getEditUrl($item)?>"><?php echo $this->__('Edit') ?></a>

                <div class="message">
                    <div><?php echo $this->getEscapedMessage($item)?></div>
                    <span class="date"><?php echo $this->getFormattedDate($item) ?></span>
                </div>

                <a href="<?php echo $this->getItemsUrl($item)?>"><?php echo $this->__('Manage Items') ?></a> <span class="separator">|</span>
                <a href="<?php echo $this->getShareUrl($item)?>"><?php echo $this->__('Share') ?></a>

            </li>
        <?php endforeach; ?>
    </ul>
    <?php echo $this->getChildHtml('pager') ?>
<?php else:?>
    <p><?php echo Mage::helper('enterprise_giftregistry')->__('There are no created gift registries yet.'); ?></p>
<?php endif;?>

<?php if ($this->canAddNewEntity()):?>
<div class="buttons-set">
    <button type="button" onclick="setLocation('<?php echo $this->escapeUrl($this->getAddUrl()) ?>')" class="button"><?php echo $this->__('Add New') ?></button>
</div>
<?php endif;?>
</div>
